package com.xc.freeapp.service.impl;
import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.xc.freeapp.dao.IssueDao;
import com.xc.freeapp.dao.dataSource.DBContextHolder;
import com.xc.freeapp.entity.Issue;
import com.xc.freeapp.service.IssueService;

@Service
public class IssueServiceImpl implements IssueService {
   
	Logger log = Logger.getLogger(this.getClass());
	
	@Autowired
	private IssueDao issueDao;

	public int deleteByPrimaryKey(Integer id) {
		DBContextHolder.switchDataSourceRW();//切换数据源
		return issueDao.deleteByPrimaryKey(id);
	}

	public int insert(Issue record) {
		DBContextHolder.switchDataSourceRW();//切换数据源
		return issueDao.insert(record);
	}

	public Issue selectByPrimaryKey(Integer id) {
		DBContextHolder.switchDataSourceRW();//切换数据源
		return issueDao.selectByPrimaryKey(id);
	}

	public int updateByPrimaryKey(Issue record) {
		DBContextHolder.switchDataSourceRW();//切换数据源
		return issueDao.updateByPrimaryKey(record);
	}

	public List<Issue> getList(String relationId,PageBounds pageBounds) {
		DBContextHolder.switchDataSourceRW();//切换数据源
		return issueDao.getList(relationId, pageBounds);
	}
	
	

}
